from django.contrib import admin
from . import models
# Register your models here.

from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
class UserAdmin(AuthUserAdmin):
    add_fieldsets = (
        (None, {
            'classes': ('wide',),
            # 添加用户界面可操作的字段
            'fields': ('username', 'password1', 'password2', 'mobile', 'email', 'is_staff', 'is_active'),
        }),
    )
    list_display = ('username', 'mobile', 'email', 'is_staff', 'is_active')

# 明文操作密码，admin可视化添加的用户密码都是明文，登录时用的是密文，所以用户无法登录
# admin.site.register(models.User)
admin.site.register(models.User, UserAdmin)
